<template>
  <div style="display: flex; background-color: #fcfcfc; padding: 5px 30px; border-radius: 5px; margin-bottom: 20px">
    <el-input v-model="value"  :placeholder="title" style="margin-right: 30px; "/>
    <el-button @click="draftHandler">保存草稿</el-button>
    <el-button type="primary" @click="releaseHandler">{{ button_title }}</el-button>
  </div>
</template>

<script>
export default {
  name: 'article-menu-header',
  props: {
    modelValue: {
      default: ''
    },
    title: {
      default: '请输入文章标题'
    },
    button_title: {
      default: '发布'
    }
  },
  computed: {
    value: {
      get () {
        return this.modelValue
      },
      set (value) {
        this.$emit('update:modelValue', value)
      }
    }
  },
  methods: {
    draftHandler () {
      this.$emit('draftHandler')
    },
    releaseHandler () {
      this.$emit('releaseHandler')
    }
  }
}
</script>

<style scoped>

</style>
